import Vue from 'vue'
import VueRouter from 'vue-router'
import Recommend from '../views/Recommend.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Recommend',
    component: Recommend
    // 首页不用懒加载
  },
  {
    path: '/hot',
    name: 'Hot',
    component: ()=>import("@/views/Hot.vue")
  },
  {
    path: '/search',
    name: 'Search',
    component: ()=>import("@/views/Search.vue")
  },
  {
    path: '/playlist/:pid',
    name: 'PlayList',
    props:true,
    component: ()=>import("@/views/PlayList.vue")
  },
  {
    path: '/mvplay/:pid',
    name: 'MvPlay',
    props:true,
    component: ()=>import("@/views/MvPlay.vue")
  }
]

const router = new VueRouter({
  //使用hash模式
  mode:"hash",
  linkActiveClass:"top-active",//普通匹配
  linkExactActiveClass:"top-exact-active",//精准匹配
  routes
});

export default router
